home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20041116-20060924
/
000403_fdc@panix.com_Sun Aug 20 16:07:57 2006.msg
< prev
next >
Wrap
Internet Message Format
|
2006-09-27
|
2KB
Path: reader2.panix.com!reader1.panix.com!panix!not-for-mail
From: Frank Da Cruz <fdc@panix.com>
Newsgroups: comp.protocols.kermit.misc
Subject: Re: logging / flushing output
Date: Sun, 20 Aug 2006 20:02:15 +0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Lines: 45
Message-ID: <slrneehfu7.j1o.fdc@panix2.panix.com>
References: <1155487576.755318.253070@b28g2000cwb.googlegroups.com>
Reply-To: fdc@columbia.edu
NNTP-Posting-Host: panix2.panix.com
X-Trace: reader2.panix.com 1156104135 29274 166.84.1.2 (20 Aug 2006 20:02:15 GMT)
X-Complaints-To: abuse@panix.com
NNTP-Posting-Date: Sun, 20 Aug 2006 20:02:15 +0000 (UTC)
User-Agent: slrn/0.9.8.0 (NetBSD)
Xref: panix comp.protocols.kermit.misc:15535
On 2006-08-13, tomviolin <rock_spambust_violin@yahoo.com> wrote:
: System: C-Kermit 8.0.211 on Linux 2.6 (Ubuntu).
:
: I have a simple script that does a straightforward interactive chat
: with a remote system. Basically it is INPUTs and OUTPUTs, with ECHO
: statements describing the action (e.g. ECHO "Waiting for login:").
:
: I use the script as a "kerbang" script (starting with
: #!/usr/local/bin/kermit +), have "set input echo on" and when I run the
: script at the terminal it works as expected, with the output from the
: remote system interspersed with the text from the ECHO statements.
:
: However, when I redirect the output to a file thusly:
:
: $ ./script.ksc > script.log 2>&1
:
: strange things happen. Doing a "tail -f script.log" from another
: window (or backgrounding the script and doing the "tail" from the same
: window) reveals that the output from the remote system is showing up in
: real time, but the output from the ECHO statements is not showing up
: until the script terminates.
:
: Why is this?
:
I/O across the connection is buffered, ECHO commands are not.
: It seems like the output from the input echo is going to
: a buffer that is being flushed regularly, while the output from the
: ECHO statements is going into another buffer that isn't being flushed.
: Strange.
:
: Any way to correct this behavior? I'd like to be able to monitor the
: progress of a background Kermit task in real time.
:
Instead of:
ECHO "Waiting for login:"
use:
WRITELN ERROR "Waiting for login:"
This writes the string to stderr, which is not buffered.
- Frank